##Stacked PLOT
##BJPS R&R: Political Competition and Riots
## Author: RJT
## THis version 24 May 2015

library(foreign)
dat<-read.csv("/Users/risatoha/Documents/Political Competition/Revisions/Conditional Accept/Tables/org3regimetype_final.csv", header=TRUE)
dim(dat)
summary(dat)

## Transpose data and assign first row as a header
dat<-t(dat)
colnames(dat) = dat[1,]
dat = dat[-1,]

## Create barplot
bar<- barplot(as.matrix(dat), xlab="Year", ylab="Number of Conflicts", 
main="Communal Conflicts (1989-2013)", space=0.5, cex.axis=0.75, 
cex.names=.75, col=c("lightblue", "blue", "darkblue"))
legend("topleft", c("Autocracies","Anocracies", "Democracies"),fill=c("lightblue", "blue", "darkblue"), cex=.75)

stop()
